/* 按钮基础样式 */
.btn {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.65;
}

/* 主要按钮 */
.btn-primary {
    color: #ffffff;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-primary:hover {
    color: #ffffff;
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.5);
}

/* 次要按钮 */
.btn-secondary {
    color: #ffffff;
    background-color: #6b7280;
    border-color: #6b7280;
}

.btn-secondary:hover {
    color: #ffffff;
    background-color: #4b5563;
    border-color: #4b5563;
}

.btn-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(107, 114, 128, 0.5);
}

/* 成功按钮 */
.btn-success {
    color: #ffffff;
    background-color: #059669;
    border-color: #059669;
}

.btn-success:hover {
    color: #ffffff;
    background-color: #047857;
    border-color: #047857;
}

.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(5, 150, 105, 0.5);
}

/* 危险按钮 */
.btn-danger {
    color: #ffffff;
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-danger:hover {
    color: #ffffff;
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.5);
}

/* 警告按钮 */
.btn-warning {
    color: #1f2937;
    background-color: #fbbf24;
    border-color: #fbbf24;
}

.btn-warning:hover {
    color: #1f2937;
    background-color: #f59e0b;
    border-color: #f59e0b;
}

.btn-warning:focus {
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.5);
}

/* 信息按钮 */
.btn-info {
    color: #1f2937;
    background-color: #60a5fa;
    border-color: #60a5fa;
}

.btn-info:hover {
    color: #1f2937;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-info:focus {
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.5);
}

/* 轮廓按钮 */
.btn-outline-primary {
    color: #3b82f6;
    background-color: transparent;
    border-color: #3b82f6;
}

.btn-outline-primary:hover {
    color: #ffffff;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-outline-secondary {
    color: #6b7280;
    background-color: transparent;
    border-color: #6b7280;
}

.btn-outline-secondary:hover {
    color: #ffffff;
    background-color: #6b7280;
    border-color: #6b7280;
}

/* 按钮尺寸 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
}

/* 块级按钮 */
.btn-block {
    display: block;
    width: 100%;
}

/* 按钮组 */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* 加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .btn-warning {
        color: #f3f4f6;
    }

    .btn-info {
        color: #f3f4f6;
    }

    .btn-outline-primary {
        color: #60a5fa;
        border-color: #60a5fa;
    }

    .btn-outline-primary:hover {
        color: #1f2937;
        background-color: #60a5fa;
        border-color: #60a5fa;
    }

    .btn-outline-secondary {
        color: #9ca3af;
        border-color: #9ca3af;
    }

    .btn-outline-secondary:hover {
        color: #1f2937;
        background-color: #9ca3af;
        border-color: #9ca3af;
    }
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: var(--shadow-card);
    z-index: 1000;
}

.dropdown-item {
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
} 